<?php
namespace app\admin\controller\supplier;

use app\common\model\Supplier as Model;

use app\admin\classes\BasicManager;
use core\Api;
use core\V;
use core\Res;

/**
 * 相册
 */


 class Manager extends BasicManager {

   static $model=Model::class;


   static $var="id,name,des,contact,mobile,address,remark";

   static $title=[
     "index"=>[
       "title"=>"供应商管理",
       "breadcrumb"=>["供应商","列表"],
       "subtitle"=>"管理供应商",
     ],
     "add"=>[
       "title"=>"添加供应商",
       "breadcrumb"=>["供应商","添加"],
       "subtitle"=>"请添加供应商",
     ],
     "edit"=>[
       "title"=>"编辑供应商",
       "breadcrumb"=>["供应商","编辑"],
       "subtitle"=>"编辑供应商",
     ],

   ];

   public function save_filter(&$data){
     empty($data["name"]) and Api::error('请输入名称');
     return $data;
   }

   public function edit_body(){
     return '
     <el-form-item label="名称">
       <el-input v-model="form.name"></el-input>
     </el-form-item>

     <el-form-item label="简介">
       <el-input type="textarea" v-model="form.des"></el-input>
     </el-form-item>

     <el-form-item label="联系人">
       <el-input v-model="form.contact"></el-input>
     </el-form-item>

     <el-form-item label="电话">
       <el-input v-model="form.mobile"></el-input>
     </el-form-item>

     <el-form-item label="地址">
       <el-input v-model="form.address"></el-input>
     </el-form-item>

     <el-form-item label="备注">
       <el-input type="textarea" v-model="form.remark"></el-input>
     </el-form-item>
     ';
   }
   public function index_body(){
     return '
     <el-table-column
       prop="name"
       label="名称"
       width="150">
     </el-table-column>

     <el-table-column
       prop="des"
       label="简介">
     </el-table-column>

     <el-table-column
       prop="contact"
       label="联系人"
       width="100">
     </el-table-column>

     <el-table-column
       prop="mobile"
       label="电话"
       width="120">
     </el-table-column>

     <el-table-column
       prop="address"
       label="地址">
     </el-table-column>


     <el-table-column
       prop="remark"
       label="备注">
     </el-table-column>
     ';
   }
   public function search_body(){
     return '

     <el-form-item label="">
       <el-input
         v-model="form.name"
         @keyup.enter.native="Search"
         placeholder="名称">
       </el-input>
     </el-form-item>

     <el-form-item label="">
       <el-input
         v-model="form.contact"
         @keyup.enter.native="Search"
         placeholder="联系人">
       </el-input>
     </el-form-item>

     <el-form-item label="">
       <el-input
         v-model="form.remark"
         @keyup.enter.native="Search"
         placeholder="备注">
       </el-input>
     </el-form-item>
     ';
   }


 }
